package wyj.com.startappactivity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.WindowManager;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        //不调用，则在锁屏界面之下运行
        nowOpen();
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Log.e("BroadcastReceivereeeee", "" + "启动....");

    }

    //直接解锁屏幕（前提没密码）
    private void nowOpen() {
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
                | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
                | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
                | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
    }

    @Override
    public void onBackPressed() {
    }
}
